package com.boarsoft.boar.config.var;

import java.util.Map;

import org.springframework.stereotype.Component;

import com.boarsoft.boar.config.var.ConfigVarProcessor;
import com.boarsoft.boar.config.var.impl.LocalConfigVarProcessor;
import com.boarsoft.common.util.StringUtil;
import com.boarsoft.config.spring.util.SpringContextUtil;

@Component
public class ConfigVarAdapter {

	private Map<String, String> drmConfigVar;

	public ConfigVarProcessor locateProcessor(String store) {
		if (StringUtil.isNotBlank(store)) {
			return SpringContextUtil.getBean(//
					store.concat("ConfigVarProcessor"), ConfigVarProcessor.class);
		}
		return SpringContextUtil.getBean(LocalConfigVarProcessor.class);
	}

	public Map<String, String> getDrmConfigVar() {
		return drmConfigVar;
	}

	public void setDrmConfigVar(Map<String, String> drmConfigVar) {
		this.drmConfigVar = drmConfigVar;
	}
}
